package com.singzi.leetcode.N1700;

public class T1629 {

    public static void main(String[] args) {

    }
}
class Solution1629 {
    public char slowestKey(int[] releaseTimes, String keysPressed) {

        int maxPress = releaseTimes[0];
        char letter = keysPressed.charAt(0);
        for (int i = 1; i < releaseTimes.length; i++) {
            if(releaseTimes[i]-releaseTimes[i-1]>maxPress||releaseTimes[i]-releaseTimes[i-1]==maxPress&&keysPressed.charAt(i)>letter)
                letter = keysPressed.charAt(i);
        }
        return letter;

    }
}